from urllib import request
from http.cookiejar import MozillaCookieJar

import os

os.chdir(r'E:\作业')

cookiejar = MozillaCookieJar('cookie.txt')
handler = request.HTTPCookieProcessor(cookiejar)
opener=request.build_opener(handler)
resp=opener.open('https://www.51moot.net/')
cookiejar.save(ignore_discard=True,ignore_expires=True)

